#if !defined(__KEYWORD_MANAGER_H)
#define __KEYWORD_MANAGER_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "File.h"
#include "CriticalSection.h"
#include "Singleton.h"

enum { _KEYWORD, _LIBRARY, _OPERATOR };

struct Keywords {
	typedef vector<Keywords> List;
	typedef List::iterator Iter;

	Keywords() { };
	Keywords(const string& aString, const int aType) throw() : keyword(aString), type(aType) { };

	GETSET(string, keyword, Keyword);
	GETSET(int, type, Type);
};

class SyntaxManager : public Singleton<SyntaxManager>
{
public:
	Keywords::List& getKeywords() { 
		Lock l(cs);
		return keywords;
	};
	void loadKeywords();
	void saveKeywords();

private:
	friend class Singleton<SyntaxManager>;
	CriticalSection cs;
	
	SyntaxManager() { };
	virtual ~SyntaxManager() { };

	Keywords::List keywords;
	void loadKeywords(SimpleXML* aXml);
	
};

#endif // !defined(__KEYWORD_MANAGER_H)